//
//  CustomUITextField.m
//  UI_Day02_homework
//
//  Created by aaaaaa on 16/6/4.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustomUITextField.h"

@implementation CustomUITextField

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

+ (instancetype)customUITextFieldWithFrame:(CGRect)frame withPlaceholder:(NSString *)placeholder{
    CustomUITextField *custom = [[CustomUITextField alloc] initWithFrame:frame];
    custom.placeholder = placeholder;
    custom.layer.borderColor = [UIColor lightGrayColor].CGColor;
    custom.layer.borderWidth = 1.0f;
    custom.layer.cornerRadius = 5.0;
    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 30)];
    custom.leftView = leftView;
    custom.leftViewMode = UITextFieldViewModeAlways;
    [leftView release];
    return [custom autorelease];
}

@end
